package lhy.autoparts.menu;

import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lhy.autoparts.pojo.IndexMenu;
import lhy.autoparts.servlet.Utf8Servlet;
import lhy.orm.Serializer;
import lhy.orm.dao.GenericDaoImpl;

import java.util.List;


@WebServlet("/IndexMenuServlet")
public class IndexMenuServlet extends Utf8Servlet {
    @Override
    protected void doGet(HttpServletRequest que, HttpServletResponse pon) {
        super.doGet(que, pon);
        List<IndexMenu> objects = new GenericDaoImpl<>(IndexMenu.class).queryForAll();
        write(pon, Serializer.doSerialize(objects.toArray()));
    }
}
